package com.ggqq.controller;


import com.ggqq.entity.Picture;
import com.ggqq.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * 照片墙 控制器
 * */

@Controller
public class PictureShowController {

    @Autowired
    private PictureService pictureService;

    @GetMapping("/picture")
    public String pictures(Model model){
        List<Picture> pictures = pictureService.listPicture();
        model.addAttribute("pictures",pictures);
        return "picture";
    }


}
